package com.hup.timer.model;

import com.hup.utils.commons.hardware.ScreenUtil;
import com.hup.utils.commons.io.BaseConfig;
import lombok.Data;

import java.awt.*;

/**
 * @author hugan
 * @date 2020/4/4
 */
@Data
public class TimeWindowConfig implements BaseConfig<TimeWindowConfig> {

    public Point loc;
    /**
     * 禁用窗口的右键菜单
     */
    public boolean disableWindowMenu = false;

    @Override
    public boolean afterLoadFromFileOrReset(TimeWindowConfig fileConfig) {
        if (loc == null) {
            //默认位置,顶部居中
            Insets coor = ScreenUtil.getScreenUsableCoor();//不与状态栏重叠
            int x = coor.right / 2;
            loc = new Point(x, coor.top);
            return true;
        }
        return false;
    }

}
